package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 请求方法限定
 * @author stone
 * @date 2021/12/30 15:01
 */
@Controller//("method")
@RequestMapping("method")
public class MethodController {

    //@RequestMapping(value = "get",method = RequestMethod.GET) //method/get
    @GetMapping("get")
    @ResponseBody
    public String methodGet() {
        return "Method GET";
    }

    //@RequestMapping(value = "post",method = RequestMethod.POST)
    @PostMapping("post")
    @ResponseBody
    public String methodPost() {
        return "Method POST";
    }

    //增加两个值，这两个值之间的关系 → or → 也就是满足其中一项即可
    @RequestMapping(value = "double",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    public String methodDouble() {
        return "Method double";
    }

}
